//
//  MinuteViewController.m
//  Type
//
//  Created by MacBook por on 2017/10/30.
//  Copyright © 2017年 Mu. All rights reserved.
//

#import "MinuteViewController.h"
#import "ViewController.h"
#import "MinType.h"
#import "HTTPMananger.h"
#import "AllType.h"
#import "UIImageView+WebCache.h"
#import "MinuteCell.h"
@interface MinuteViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic, strong) NSArray *theAllType;
@property (nonatomic, strong) NSMutableArray <MinType *>* MInList;
@property (weak, nonatomic) IBOutlet UITableView *tableView;



@end

@implementation MinuteViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
    self.MInList = [NSMutableArray new];
    for (MinType *type in self.theAllType) {
        [self.MInList addObject:type];
    }
    [self.tableView registerNib:[UINib nibWithNibName:@"MinuteCell" bundle:nil] forCellReuseIdentifier:@"MCell"];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.MInList.count;
}


-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MCell" forIndexPath:indexPath];
//    cell.textLabel.text = self.MInList[indexPath.row].name;
    NSString *url = [NSString stringWithFormat:@"https://cdnme.azurewebsites.net/image/imagesize?filename=%@&param=%@",self.MInList[indexPath.row].pic,@"100x100"];
  UIImageView *imageView=[cell viewWithTag:1];
    [imageView sd_setImageWithURL:[NSURL URLWithString:url]];

//    [self.imageView sd_setImageWithURL:[NSURL URLWithString:url]];
    UILabel *briefLabel=[cell viewWithTag:2];
    briefLabel.text=self.MInList[indexPath.row].name;

    
    return cell;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
